class Pager:

    @staticmethod
    def offset(page: int = 1, limit: int = 10):
        """
        计算 offset 值

        Args:
            page (int): 页码
            limit (int): 分页大小

        Returns:
            int: offset值
        """
        if page < 1:
            page = 1
        if limit < 1:
            limit = 10
        return (page - 1) * limit
